<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8"%>
<%
    String path = request.getContextPath()+"/";
%>
<!DOCTYPE html>
<html>

<head>
    <base href="<%=path%>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <title>在线申请信用贷款</title>
    <link type="text/css" rel="Stylesheet" href="static/H5/css/mobiscroll.css">
    <link rel="stylesheet" type="text/css" href="static/H5/css/index.css" />
    <link rel="stylesheet" type="text/css" href="static/H5/css/mobile-select.css">
    <link rel="stylesheet" type="text/css" href="static/H5/css/iosSelect.css">
    <script type="text/javascript">
        var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
        document.write(unescape("%3Cspan  style='display:none;'  id='cnzz_stat_icon_1271494136'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1271494136' type='text/javascript'%3E%3C/script%3E"));


        var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
        document.write(unescape("%3Cspan  style='display:none;'  id='cnzz_stat_icon_1273129975'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1273129975' type='text/javascript'%3E%3C/script%3E"));

    </script>

</head>

<body>
<!--进度条-->
<div class="container">
    <ul id="progress">
        <li>
            <div id="layer1" class="ball"></div>
            <div id="layer7" class="pulse"></div>
        </li>
        <li>
            <div id="layer2" class="ball"></div>
            <div id="layer8" class="pulse"></div>
        </li>
        <li>
            <div id="layer3" class="ball"></div>
            <div id="layer9" class="pulse"></div>
        </li>
    </ul>
</div>
<div class="content">
    <div style="display: none;">
        <input type="hidden" name="" id="username">
        <!-- 姓名说-->
        <input type="hidden" name="" value="0" id="sex">
        <!-- 性别-->
        <input type="hidden" name="" id="telephoneNum">
        <input type="hidden" name="" id="CityValue">
        <input type="hidden" name="" id="areaCode">
        <input type="hidden" name="" id="areaName">
        <input type="hidden" id="birthdayValue">


    </div>
    <img src="static/H5/images/bao.png" class="banner1" />
    <div class="warp1">

        <div class="san">
            <ul>
                <li>
                    <img src="static/H5/images/pic1.png" />
                    <p>
                        <b>最快</b>1小时到账</p>
                </li>
                <li>
                    <img src="static/H5/images/pic2.png" />
                    <p>
                        <b>最高</b>20万现金</p>
                </li>
                <li>
                    <img src="static/H5/images/pic3.png" />
                    <p>
                        <b>最长</b>48个月期限</p>
                </li>
            </ul>
            <div style="clear:both;"></div>
        </div>
        <div class="dingdan">
            <div class="xian">
                <b>填写真实信息，有助于贷款成功！</b>
            </div>
            <div class="tr">
                <div class="left">
                    <input height="24" class="input" id="username2" placeholder="中文姓名" style="width:98%;padding-left:2%;">
                </div>
                <div class="right" style="line-height:40px;">

                    <label class="sex-btn" style="margin-left:0.6rem;" data-value="1">女</label>
                    <label class="sex-btn checked" data-value="0">男</label>
                    <!--<label><input type="radio" value="1" class="option-input radio" name="sex2"  checked="checked">男</label>
                            <label style="padding-left:10%;"><input type="radio" value="0" class="option-input radio" name="sex2">女</label>-->
                </div>
                <div style="clear:both;"></div>
            </div>
            <div class="tr">
                <input type="Number" height="24" size="20" maxlength="13" class="input" id="mobile2" placeholder="您的手机号码" style="width:98%; padding-left:2%;">
            </div>
            <div class="tr">
                <div class="left">
                    <input type="Number" height="24" class="input" maxlength="6" placeholder="短信验证码" style="width:98%;padding-left:2%;" id="textcode"
                           name="textcode">
                </div>
                <div class="right">
                    <input type="button" value="获取验证码" id="getcode" name="getcode" onClick="sub()" style="width:100%;border-radius:8px; height:40px; text-align:center; background-color:#27b3dc; border:0; color:#FFF; font-size:1.2em;-webkit-appearance: none;">
                </div>
                <div style="clear:both;"></div>
            </div>
            <div class="tr">
                <div class="left move_item" style="width:100%;box-sizing: border-box;">
                    <div id="select_contact">
                        <!-- <input readonly height="24" size="20" maxlength="13" class="input" id="mobile2" placeholder="城市" style="width:98%; padding-left:2%;"> -->
                        <span data-city-code="" data-province-code="" data-district-code="" id="show_contact" style="font-size: 1.09em;">城市</span>
                        <input type="hidden" name="CITY" style="display: none;">
                        <input type="text" name="PROVINCE" style="display: none;">
                    </div>
                </div>
                <div class="left move_item" style="width:98%;margin-top: 2%;">
                    <input readonly id="birthday" name="birthday" class="arrow birth input" type="text" placeholder="您的生日" style="width:100%;"
                    />
                </div>
                <div style="clear:both;"></div>
            </div>

             	<%--<div class="tr" >
                    <div id="auditBy" class="move_item">微粒贷是否借过钱</div>
                    <input readonly height="24" size="20" maxlength="13" class="input"  placeholder="微粒贷是否借过钱" style="width:98%; padding-left:2%;">
                </div>--%>


            <!-- 原来微粒贷 -->
            <%--<div class="right_1 ifshow" style="display: block;">
                        <label><input type="radio" value="2" class="option-input2 radio" name="wx" checked="checked">是</label>&nbsp;&nbsp;
                        <label><input type="radio" value="1" class="option-input2 radio" name="wx">否</label>&nbsp;&nbsp;
                        <label><input type="radio" value="3" class="option-input2 radio" name="wx">已还完</label>
                    </div>--%>
            <!-- 原来微粒贷 -->




            <div class="tr" style="position:relative;">
                <input type="button" value="点击立即申请" onClick="checkParameterone();" style="height:40px; width:96%; margin:0 auto; display:block; border-radius:6px; text-align:center; background:#fc5b03; color:#fff; font-size:1.2rem; border:0;-webkit-appearance:none;">
                <span id="smlpic">
						<img src="static/H5/images/arrow.png">
					</span>
                <p style="margin-top:5px;">
                    <input type="checkbox" id="safe" checked="checked" style="margin-right:10px;">同意
                    <span id="aqtk" style="color:#fc5b03;">《用户服务协议》</span>并申请信用贷款
                </p>
                <p style="margin-top:5px;">
                    <input type="checkbox" checked style="margin-right:10px;">申请有礼：送100万赔付意外险，平安出行
                </p>
            </div>
        </div>
        <div style="color:#9b9a99; padding:10px 2%;">平台郑重承诺：所有贷款申请在未成功放款前绝不收取任何费用，为保障您的资金安全，请不要相信任何要求您支付费用的信息、邮件、电话等不实信息。</div>
        <div class="xian">
            <strong>拿到钱，您可以做这些</strong>
        </div>

        <div class="si">
            <ul>
                <li>
                    <img src="static/H5/images/pic4.png" />
                    <p>买房装修</p>
                </li>
                <li>
                    <img src="static/H5/images/pic5.png" />
                    <p>购物旅游 </p>
                </li>
                <li>
                    <img src="static/H5/images/pic6.png" />
                    <p>创业理财 </p>
                </li>
                <li>
                    <img src="static/H5/images/pic7.png" />
                    <p>资金周转</p>
                </li>
            </ul>
            <div style="clear:both;"></div>
        </div>

    </div>
    <div style="display:none;">
        <%--<script src="https://s13.cnzz.com/z_stat.php?id=1262241013&web_id=1262241013" language="JavaScript"></script>--%>
    </div>

    <!--<2>-->
    <div class="warp2" style="display:none; ">
        <div class="list">
            <input type="hidden" value="" id="creditSituation" />
            <input type="hidden" value="" id="house" />
            <input type="hidden" value="" id="car" />
            <input type="hidden" value="" id="housingFund" />
            <input type="hidden" value="" id="socialSecurity" />
            <input type="hidden" id="profession" value="">
            <input type="hidden" value="" id="income" />
            <input type="hidden" value="" id="paytype" />
            <input type="hidden" value="" id="worklong" />
            <input type="hidden" value="" id="enpass" />
            <input type="hidden" value="1" id="insurance" />
            <input type="hidden" value="1" id="acceptsafety" />
            <input type="hidden" value="" id="baodan" />
            <!-- 是否使用微粒贷-->
            <input type="hidden" value="2" id="isAtom">



            <!-- <div class="xian"><b>完善信息，你可以获得更多贷款</b></div> -->
            <!-- <img src="images/banner2.jpg" style="height: 20%;" class="banner2" />					 -->
            <div class="item item_1">
                <span>期望贷款:</span>
                <input class="input" type="Number" id="edu" placeholder="期望贷款额" />
                <b style="padding-left:1%;">元</b>
            </div>
            <!-- 寿险保单 和信用情况开始 -->
            <div class="item item_3 creditSituation_">
                <span>寿险保单:</span>
                <input class="" type="button" data-p="1" value="有" onClick="setLabelsSpecial(this,'baodan','2');" />
                <input type="button" data-p="0" value="无" onClick="setLabelsSpecial(this,'baodan','1');" />
            </div>
            <!-- 寿险弹框 开始 -->
            <div class="item item_3 baodanifshow" style="display: none;">
                <span></span>
                <input type="button" class="bigBtn" data-p="3" value="保单额度2400以上" onClick="setLabels(this,'baodan','3');" />
                <input class=" bigBtn" type="button" data-p="2" value="保单额度2400以下" onClick="setLabels(this,'baodan','2');" />
            </div>
            <!-- 寿险弹框 开始 -->
            <div class="item item_3 ">
                <span>信用情况:</span>
                <input class="bigBtn" type="button" data-p="1" value="有信用卡或贷款" onClick="setLabels(this,'creditSituation','2');" />
                <input class="bigBtn" type="button" data-p="2" value="无信用卡无贷款" onClick="setLabels(this,'creditSituation','1');" />
            </div>
            <!-- 寿险保单 和信用情况结束 -->
            <!-- <div class="item item_2">
                    <span>您的生日:</span>
                    <input readonly id="birthday" name="birthday" class="arrow birth input" type="text" placeholder="您的生日" />
                </div> -->
            <div class="item item_3">
                <span>名下房产:</span>
                <input type="button" data-p="3" value="有房无贷" onClick="setLabels(this,'house','3');" />
                <input class="" type="button" data-p="2" value="有房贷" onClick="setLabels(this,'house','2');" />
                <input data-p="1" style="margin-right: 0px;" type="button" value="无房" onClick="setLabels(this,'house','1');" />
            </div>
            <div class="item item_4">
                <span>名下汽车:</span>
                <input type="button" data-c="3" value="有车无贷" onClick="setLabels(this,'car','3');" />
                <input type="button" class="" data-c="2" value="有车贷" onClick="setLabels(this,'car','2');" />
                <input data-c="1" style="margin-right: 0px;" type="button" value="无车" onClick="setLabels(this,'car','1');" />
            </div>
            <div class="item item_6">
                <span>公积金:</span>
                <input type="button" class="" data-f="2" value="1年以上" onClick="setLabels(this,'housingFund','2');" />
                <input type="button" data-f="1" value="1年以内" onClick="setLabels(this,'housingFund','1');" />
                <input data-f="0" style="margin-right: 0px;" type="button" value="无公积金" onClick="setLabels(this,'housingFund','0');" />
            </div>
            <div class="item item_7">
                <span>社会保险:</span>
                <input type="button" class="" data-s="2" value="1年以上" onClick="setLabels(this,'socialSecurity','2');" />
                <input type="button" data-s="1" value="1年以内" onClick="setLabels(this,'socialSecurity','1');" />
                <input data-s="0" style="margin-right: 0px;" type="button" value="无社保" onClick="setLabels(this,'socialSecurity','0');" />
            </div>
            <!-- 微粒贷 开始 -->
            <div class="item item_3 ">
                <span>是否用过微粒贷:</span>
                <input class="bigBtn" type="button" data-p="1" value="是" onClick="setLabels(this,'isAtom','1');" />
                <input class="bigBtn" type="button" data-p="2" value="否" onClick="setLabels(this,'isAtom','2');" />
            </div>
            <div class="item item_5">
                <span>您的职业:</span>
                <input type="button" value="白领" class="profes" onClick="selectProfession(this,'profession','0',[1,2,3]);" />
                <input type="button" value="公务员" class="profes" onClick="selectProfession(this,'profession','2',[1,2,3]);" />
                <input type="button" class="profes" style="margin-right: 0px;" value="私企业主" onClick="selectProfessionSpecial(this,'profession','1',[1,2,4]);"
                />
            </div>
            <div id="tab">
                <div class="up" style="position:relative; width:100%; height:1px;">
                    <b class="b0 b1"></b>
                    <b class="b0 b2"></b>
                    <b class="b0 b3"></b>
                </div>
                <!--<img class="trange" src="images/download.png" />-->
                <!--白领-->
                <div class="tab_1">
                    <div class="item item_6" id="subselect_1" style="display: none">
                        <span>工资发放：</span>
                        <input id="start_label_1" type="button" value="银行转账" onClick="setLabels(this,'paytype','1');" />
                        <input type="button" id="beshow" value="现金发放" onClick="setLabels(this,'paytype','2');" />
                    </div>
                    <div class="item item_9" id="subselect_3" style="display: none">
                        <span>工作时间：</span>
                        <input type="button" value="6个月内 " onClick="setLabels(this,'worklong','6')" />
                        <input type="button" id="start_label_3" value="12月内" onClick="setLabels(this,'worklong','12')" />
                        <input type="button" style="margin-right: 0px; " value="1年以上 " onClick="setLabels(this,'worklong','24')" />
                    </div>
                    <div class="item item_10" id="subselect_4" style="display: none">
                        <span>营业执照：</span>
                        <input type="button" value="12月内 " onClick="setLabels(this,'worklong','12')" />
                        <input type="button" id="start_label_4" value="1年以上 " onClick="setLabels(this,'worklong','24')" />
                    </div>
                    <div class="item item_7" id="subselect_2" style="display: none">
                        <span class="ch" style="vertical-align: middle;">月收入：</span>


                        <!-- <div style="border:1px solid #cecece;vertical-align: middle;width: 75%;background: #fff;display: inline-block;height: 40px; color: #333;line-height: 40px;text-align: center;"
                                id="income_inpt">55</div> -->
                        <input id="income_input" readonly style="border:1px solid #cecece;vertical-align: middle;width: 78%;background: #fff;display: inline-block;height: 40px; color: #333;line-height: 40px;text-align: center;">

                    </div>
                    <!--<div class="item item_8" id="subselect_3" style="display: none">
                        <span>公积金：</span>
                        <input type="button" value="一年以内 " onClick="setLabels(this,'housingFund','1');" />
                        <input type="button" id="start_label_3" value="一年以上 " onClick="setLabels(this,'housingFund','2');" />
                        <input type="button" style="margin-right: 0px; " value="无公积金 " onClick="setLabels(this,'housingFund','0');" />
                    </div>-->


                </div>

            </div>
            <div class="tj" style="position:relative;">
                <input type="button" id="btn" style="-webkit-appearance:none;" value="提交完成申请" />
                <span id="smlpic2">
						<img src="static/H5/images/arrow.png">
					</span>
                <div class="check">
                    <p style="margin-top: 5px; font-size: 13px;">
                        <input id="radio" checked="checked" type="checkbox" style="margin-right:4px;" />
                        <span style="color: rgb(170,170,169);">现在申请，即可免费领取最高100万出行意外险</span>
                    </p>
                    <p style="font-size: 13px;">我确定并了解本次
                        <a class="hdsm" style="color: #fc5b03;">活动规则 </a>及
                        <a class="xxaq" style="color: #fc5b03;">信息安全说明</a>
                    </p>
                </div>
            </div>
        </div>
        <div class="info" style=" font-size: 13px;">
				<span>您提供的个人信息仅供本次活动使用，我们不会泄露给任何第三方或其他用途</span>
        </div>
    </div>
    <div style="text-align: center;color: #9b9a99;background-color:#FFFFFF;margin-top: 2px; padding:5px 15px; font-size: 12px;">

        <%--<p>&copy; 2017 卡王贷版权所有</p><br/>投资有风险，投入需谨慎</p>--%>
            资金来源：湖北消费金融股份有限公司、中国民生银行股份有限公司、招商银行股份有限公司，根据审核结果不同额度不同
    </div>
</div>
<div class="dk_popupContainer">
    <a class="popupBg"></a>
    <div class="popupContent">
        <h3 class="title">温馨提示
            <a class="close"></a>
        </h3>
        <p class="msgContent">
            <span class="msg">验证码已发送，请注意查收</span>
            <a class="sure">确认</a>
        </p>
    </div>
</div>
<div class="aqtka"></div>

</body>
<script src="static/H5/js/ec_valid.js"></script>
<script src="static/H5/js/ec_gsc.js"></script>
<script type="text/javascript" src="static/H5/js/jquery.min.js"></script>
<script type="text/javascript" src="static/H5/js/ec_ac_jh.js"></script>
<script type="text/javascript" src="static/H5/js//finutil_a.js"></script>
<script type="text/javascript" src="static/H5/js/crypto-js.js"></script>
<script type="text/javascript" src="static/H5/js/mobiscroll.js"></script>
<script type="text/javascript" src="static/H5/js/alert_2.js"></script>
<!-- <script type="text/javascript" src="js/alert.js"></script> -->
<script type="text/javascript" src="static/H5/js/mobile-select.js"></script>
<script type="text/javascript" src="static/H5/js/iscroll.js"></script>
<script type="text/javascript" src="static/H5/js/areaData_v2.js"></script>
<script type="text/javascript" src="static/H5/js/iosSelect.js"></script>

<script>
    var gsc = new EC_GSC('FIN');
    /**
     * 参数判断，请使用公共类进行判断ec_valid.js。
     * @returns {boolean}
     */
    function checkParameterone() {
        if (!isCnName($("#username2").val())) {
            $("#username2").focus();
            alert("请正确填写用户名，以便我们方便联系您！");
            return false;
        }
        if (!isPhoneNumber($("#mobile2").val())) {
            $("#mobile2").focus();
            alert("您的电话输入有误，请重新填写！");
            return false;
        }
        if (isNull($("#sex").val())) {
            alert("请选择性别！");
            return false
        }
        if ($("#show_contact").text() == "城市") {
            alert("请选择城市！");
            return false
        }
        if (isNull($("#birthday").val())) {
            alert("请选择生日！");
            return false
        }

        if ($("#textcode").val().length !== 6) {
            $("#textcode").focus();
            alert("请正确输入验证码！");
            return false;
        }

        var mobile = $("#mobile2").val(),
            code = $("#textcode").val();
        gsc.verifyCode(mobile, code, smsCodeCallback);
//        goto();

    }
    // 手机输入框失去焦点获取城市
    $("#mobile2").on("focusout", blurHander);
    // $(window).on("click",offlurHander);

    function blurHander() {
        if (isPhoneNumber($("#mobile2").val()) && $("#show_contact").text() == "城市") {
            getCityAjax($('#mobile2').val(), 'getCityCallback');
            // console.log($("#show_contact").text())
        } else {

        }
    }

    function offlurHander() {

        $("#mobile2").off("focusout", blurHander)
    }
    function smsCodeCallback(ret) {
        console.log("Sms verify result = " + ret);
        if (ret === 0) {
            submitBaseInfo();

        } else {
            alert("验证码输入错误");

        }
    }
    function submitBaseInfo(){
        var mobile = $("#mobile2").val();
        var name = $("#username2").val();
        var sex = $("#sex").val();
        var city = $("#CityValue").val();
        var birthday = $("#birthday").val();
        var cid = getQueryString("cid");
        $.ajax({
            url:"user/signUp",
            type:"POST",
            data:{"phoneno":mobile,
                    "name":name,
                    "sex":sex,
                    "cid":cid,
                    "city":city,
                    "birthday":birthday
                },
            success: function(data){
                if(data.code == 200 ){
                    goto();
                }
            },
            error: function(XMLHttpRequest, textStatus, errorThrown){
                console.log(XMLHttpRequest);
                alert("请求失败，请重新进行提交");
            }
        });
    }
    //先获取URL参数
    var bm = getQueryString("bm");
    var cid = getQueryString("cid");

    var channel = 'EC-SJBD';

    //金融处理对象。
    var F = new FINUtil(channel, cid);

    //获取城市
    var eac;

    $(document).ready(function () {
        //ecl.load();

        $("#btn").click(function () {
            console.log("click submit");
            if (checkParameter()) {
                $("#btn").css("backgroundColor", "#ccc");
                $("#btn").attr("disabled", "disabled");
                $("#btn").attr("value", "您已提交");
                $(".container").show();
                $("#progress").addClass("running");

                finsubmit()
            }
        });

    });


    // 城市选择 start
    var selectContactDom = $('#select_contact');
    var showContactDom = $('#show_contact');
    selectContactDom.bind('click', function () {
        var sccode = showContactDom.attr('data-city-code');
        var scname = showContactDom.attr('data-city-name');

        var oneLevelId = showContactDom.attr('data-province-code');
        var twoLevelId = showContactDom.attr('data-city-code');
        var threeLevelId = showContactDom.attr('data-district-code');
        var iosSelect = new IosSelect(2,
            [iosProvinces, iosCitys],
            {
                title: '所在城市',
                headerHeight: 3,
                itemHeight: 3,
                relation: [1, 1, 0, 0],
                oneLevelId: oneLevelId,
                twoLevelId: twoLevelId,
                cssUnit: 'rem',
                // threeLevelId: threeLevelId,
                callback: function (selectOneObj, selectTwoObj, selectThreeObj) {
                    showContactDom.attr('class', 'active');
                    showContactDom.attr('data-province-code', selectOneObj.id);
                    showContactDom.attr('data-city-code', selectTwoObj.id);
                    $("input[name='CITY']").val(selectTwoObj.value);
                    $("input[name='PROVINCE']").val(selectOneObj.value);
                    showContactDom.html(selectTwoObj.value);
                    $("#CityValue").val(selectTwoObj.value);
                    $("#areaCode").val(selectTwoObj.id);
                    $("#areaName").val(selectTwoObj.value);
                }
            });
    });
    // 城市选择 end

    var mobileSelect1 = new MobileSelect({
        trigger: '#income_input',
        title: '选择月收入',
        wheels: [
            { data: ['3000以下', '3000-5000', '5001-8000', '8001-10000', '1万以上'] }
        ],
        callback: function (indexArr, data) {
            var mon_arr = ['1', '2', '3', '4', '5'];
            $("#income_input").val(data[0])
            $("#income").val(mon_arr[indexArr[0]])
            // console.log(indexArr[0],data,mon_arr[indexArr[0]])
        }

    });

    /**
     * 统一提交方法，提交到金融平台。
     */
    var phoneNo, username, sex, creditSituation;
    var city = '';

    function givnum() {
        phoneNo = $("#mobile2").val();
        username = $("#username2").val();
        sex = $("#sex").val();
        creditSituation = $("#creditSituation").val();
    }

    function finsubmit() {
        givnum();
        dosubmit();
    }

    function submitCallback(data) {
        var house = $("#house").val();
        var car = $("#car").val();
        var mon = $("#edu").val();
        city = $("#CityValue").val();
        var tzurl = "https://lo139.com/webview/user/baseIndexUnion?"
        //var tzurl = "user/baseIndexUnion?"
        tzurl = tzurl + "house=" + house;
        tzurl = tzurl + "&car=" + car;
        tzurl = tzurl + "&money=" + mon;
        tzurl = tzurl + "&city=" + escape(city);
        tzurl = tzurl + "&housing=" + $("#housingFund").val();
        tzurl = tzurl + "&bm=" + getQueryString("bm");
        tzurl = tzurl + "&cid=" + getQueryString("cid");
        tzurl = tzurl + "&channel=" + channel;
        tzurl = tzurl + "&birthday=" + $("#birthday").val();
        tzurl = tzurl + "&tel=" + phoneNo;
        tzurl = tzurl + "&username=" + escape(username);
        tzurl = tzurl + "&sex=" + sex;

        window.location.href = tzurl;

    }

    function dosubmit() {

        F.appendDataSet(getSubmitData());
        F.activiteCall('EC', 'submitCallback');
        // _taq.push({convert_id: "73871859038", event_type: "form"});
    }
    /**
     * 统一提交方法，提交到金融平台。
     */
    function cachSubmit() {
        F.appendDataSet(getSubmitData());
        F.submitAgents();
    }

    function getSubmitData() {
        var infostr = {
            worklong: $("#worklong").val(),
            enpass: $("#enpass").val()
        };
        var obj = [{
            phoneno: phoneNo
        },
            {
                name: username
            },
            {
                money: $("#edu").val()
            },
            {
                sex: sex
            },
            {
                city: $("#CityValue").val()
            },
            {
                areaCode: $("#areaCode").val()
            },
            {
                areaName: $("#areaName").val()
            },
            {
                profession: $("#profession").val()
            },
            {
                socialSecurity: $("#socialSecurity").val()
            },
            {
                housingFund: $("#housingFund").val()
            },
            {
                birthday: $("#birthday").val()
            }, //生日
            {
                income: $("#income").val()
            }, //月薪
            {
                insurance: $("#insurance").val()
            },
            {
                housingType: $("#house").val()
            },
            {
                hasCar: $("#car").val()
            },
            {
                creditSituation: creditSituation
            },
            {
                paytype: $("#paytype").val()
            },
            {
                worklong: $("#worklong").val()
            },
            //{ backUrl: backurl },
            {
                acceptsafety: $("#acceptsafety").val()
            },
            {
                info: JSON.stringify(infostr)
            },
            {
                lifeInsurance: $("#baodan").val()
            },
            {
                isAtom: $("#isAtom").val()
            }

        ];
        return obj;
    }

    //三角形显示隐藏
    $(".profes").click(function () {
        $(".up b").eq($(this).index() - 1).css("display", "block").siblings().css("display", "none")
    });
    /**
     * 参数验证使用统一的方法
     */
    function checkParameter() {
        //		验证贷款
        if (!isMoneyBetween($("#edu").val(), 1000, 5000000)) {
            alert("请正确输入金额（1000——5000000）");
            return false;
        }
        // 验证保单

        if (isNull($("#baodan").val())) {
            alert("请选择您的寿险保单信息");
            return false;
        }

        // 验证信用
        if (isNull($("#creditSituation").val())) {
            alert("请选择您的信用情况");
            return false;
        }
        // 房产信息
        if (isNull($("#house").val())) {
            alert("请选择您的名下房产情况");
            return false;
        }
        // 汽车信息
        if (isNull($("#car").val())) {
            alert("请选择您的名下汽车情况");
            return false;
        }
        // 公积金信息
        if (isNull($("#housingFund").val())) {
            alert("请选择您的公积金");
            return false;
        }
        // 社会保险信息
        if (isNull($("#socialSecurity").val())) {
            alert("请选择您的社会保险信息");
            return false;
        }
        //验证职业
        if (isNull($("#profession").val())) {
            alert("请选择您的职业");
            return false;
        }
        //验证月收入
        if (isNull($("#income_input").val())) {
            alert("请选择您的月收入");
            $("#income_input").focus();
            return false;
        }


        return true;
    }
    $(".sex-btn").click(function () {
        $(this).addClass("checked").siblings().removeClass("checked");
        $("#sex").val($(this).attr("data-value"));
    });
    /**
     * 界面选择控制
     * @param element
     * @param elementName
     * @param value
     * @param subs
     */
    function selectProfession(element, elementName, value, subs) {
        resetGroup();
        setLabels(element, elementName, value);
        openSelectItem(subs);

    }

    function selectProfessionSpecial(element, elementName, value, subs) {
        resetGroup();
        setLabels(element, elementName, value);
        openSelectItem(subs);
//        if (value == "1") {
//            $("#start_label_1").hide();
//            $("#paytype").val("2");
//            $("#beshow").addClass("checked").siblings().removeClass("checked");
//
//        } else {
//            $("#start_label_1").show();
//            $("#paytype").val("1");
//        }
    }
    function setElementValue(elementName, value) {
        $("#" + elementName).val(value);
    }

    function setLabels(element, elementName, value) {
        setElementValue(elementName, value);
        $(element).addClass("checked").siblings().removeClass("checked");
    }
    function setLabelsSpecial(element, elementName, value) {
        value === "2" ? $(".baodanifshow").show() : $(".baodanifshow").hide()
        setElementValue(elementName, value);
        $(element).addClass("checked").siblings().removeClass("checked");
    }

    function resetGroup() {
        $("#paytype").val("1");
        // $("#income").val("");
        $("#worklong").val("12");
        $("#enpass").val("1");
        // $("#income_input").val("");
    }

    function openSelectItem(items) {
        for (var j = 1; j <= 4; j++) {
            $("#subselect_" + j).hide();
            $("#start_label_" + j).addClass("checked").siblings().removeClass("checked");
        }
        for (var i = 0; i < items.length; i++) {
            //$("#subselect_" + items[i]).css("display", "block");
            $("#subselect_" + items[i]).show();
        }
    }

    //对勾
    $("#radio").click(function () {
        //$(this).toggleClass("c_on");
        $("#insurance").val(1 - eval($("#insurance").val()));
    });
    $("#safe").click(function () {
        $("#acceptsafety").val(1 - eval($("#acceptsafety").val()));
    });

    //生日插件
    var currYear = new Date().getFullYear();
    $("#birthday").mobiscroll().date({
        theme: 'android-holo-light',
        mode: 'scroller',
        display: 'modal',
        lang: 'zh',
        dateFormat: 'yy-mm-dd',
        defaultValue: new Date(1992, 5, 15),
        startYear: currYear - 60,
        endYear: currYear - 18
    });

    $(".close,.sure").click(function () {
        $(".dk_popupContainer").fadeOut()
    });

    function sub() {
        if (!(/^1[3|4|5|7|8][0-9]\d{4,8}$/.test($("#mobile2").val())) || $("#mobile2").val().length !== 11) {
            $("#mobile2").focus();
            alert("您的电话输入有误，请重新填写！");
            return false;
        }
        $(".dk_popupContainer").fadeIn();
        var oCodeBtn = $("#getcode");
        oCodeBtn.css("backgroundColor", "#8a8888");
        oCodeBtn.attr("disabled", "disabled");
        //			oCodeBtn.attr("value", "1分钟后再试");
        var i = 100;

        var timer = setInterval(function () {
            if (i === 0) {
                clearInterval(timer);
                oCodeBtn.css("backgroundColor", "#27b3dc");
                oCodeBtn.removeAttr("disabled");
                oCodeBtn.attr("value", "获取短信验证码");
                return;
            }
            oCodeBtn.attr("value", "请" + i + "秒后再试");
            i--
        }, 1000);

        var mobile = $('#mobile2').val();
        isExist(mobile);
    }

    //
    function isExist(mobile) {
        $.ajax({
            url:"user/is_exist",
            type:"POST",
            data:{"mobile":mobile},
            success: function(data){
                if(data.code == 50107 ){
                    isExistFlag = true;
                    //用户已注册，直接跳转到超市页
                    var tzurl = "https://lo139.com/webview/user/baseIndexUnion?"
                    //var tzurl = "user/baseIndexUnion?"
                    tzurl = tzurl + "&tel=" + mobile;
                    window.location.href = tzurl;
                } else {
                    gsc.getCode(mobile);
                }
            },
            error: function(XMLHttpRequest, textStatus, errorThrown){
                console.log(XMLHttpRequest);
                alert("请求失败，请重新进行提交");
            }
        });

    }

    function goto() {
        $(".warp1").css("display", "none");
        $(".warp2").css("display", "block");
        $("body").scrollTop(0);
        $(".banner1").attr("src", "static/H5/images/banner2.jpg")
        //$("html").css("font-size", "10px");
        //eac = new EC_AUTO_CITY($('#mobile2').val(), '');
        // getCityAjax($('#mobile2').val(), 'getCityCallback');
    }

    //第一次获取城市。
    function getCityCallback(data) {
        if (data.code === "0") {
            city = data.data + "市";
            console.log(city)
            $("#show_contact").text(city);
            $("#CityValue").val(city);
            //清空原始值
            $("#areaCode").val("");
            $("#areaName").val("");

        }


    }

</script>

</html>